﻿///////////////////////////////////////////////////////////
//  Class			:	Blocks.cs
//  CLRVersion		:	4.0.30319.42000
//  NameSpace		:	BenNHTetris
//  Created on		:	2018/5/31 14:32:10
//  Original author	:	JIYONGFEI 
//  JiYF笨男孩博客  :   https://www.cnblogs.com/JiYF/
///////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BenNHTetris
{
    class Blocks
    {
        public static ArrayList BlockList = new ArrayList();
        //随机获取一个砖块
        public static Block GetBlock()
        {
            Random random = new Random();
            int index = random.Next(7);
            Block block;
            switch (index)
            {
                case 0:
                    block = new Block1();
                    break;
                case 1:
                    block = new Block2();
                    break;
                case 2:
                    block = new Block3();
                    break;
                case 3:
                    block = new Block4();
                    break;
                case 4:
                    block = new Block5();
                    break;
                case 5:
                    block = new Block6();
                    break;
                case 6:
                    block = new Block7();
                    break;
                default:
                    block = new Block1();
                    break;
            }
            return block;
        }
    }
}
